package com.wisdom.demo.mapper;

import com.wisdom.demo.model.ArticleInfo;
import com.wisdom.demo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 11951
 * Date: 2025-03-21
 * Time: 10:32
 */
/*
* 多表查询
* */
@Mapper
public interface ArticleMapper {
    @Select("SELECT ta.id,ta.title,ta.content,ta.uid,tb.username,tb.age,tb.gender " +
            "FROM article_info ta LEFT JOIN user_info tb ON ta.uid = tb.id  " +
            "WHERE ta.id = #{id}")
    List<UserInfo> queryAllUser(Integer id);
}
